import type { ITableConfig } from '@/components/table/type'

import { getMenuList } from '@/service/menu/menu'
const menuTableConfig: ITableConfig = {
  tableColumns: [
    {
      prop: 'name',
      label: '菜单名称'
    },
    {
      prop: 'type',
      label: '类型',
      width: '100px'
    },
    {
      prop: 'url',
      label: '菜单url',
      width: '100px'
    },
    {
      prop: 'icon',
      label: '菜单icon',
      width: '100px',
      slotName: 'image'
    },
    {
      prop: 'status',
      label: '状态',
      width: '100px',
      slotName: 'status'
    },
    {
      prop: 'permission',
      label: '权限',
      width: '100px'
      // slotName: 'status'
    },
    {
      prop: 'createAt',
      label: '创建时间',
      slotName: 'createAt'
    },
    {
      prop: 'updateAt',
      label: '更新时间',
      slotName: 'updateAt'
    },
    {
      label: '操作',
      slotName: 'handler'
    }
  ],
  showIndexColumn: false,
  showSelectColumn: false,
  showFooter: false,
  childrenProps: {
    rowKey: 'id',
    treeProps: { children: 'children' }
  },
  getData: getMenuList
}

export { menuTableConfig }
